honor min_width and max_width while resizing columns (pointed out by Jorn
authorKristian Rietveld <kris@gtk.org>
Sat, 23 Feb 2002 02:13:10 +0000 (02:13 +0000)
committerKristian Rietveld <kristian@src.gnome.org>
Sat, 23 Feb 2002 02:13:10 +0000 (02:13 +0000)
Sat Feb 23 03:10:20 2002  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtktreeview.c (gtk_tree_view_key_press): honor min_width and
        max_width while resizing columns (pointed out by Jorn Baayen)

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktreeview.c

index e6b85e16d49c315ff6999479f69142ff27902736..c6a438c3c72ea5f745d661a05f8dc73f75db2651 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Feb 23 03:10:20 2002  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreeview.c (gtk_tree_view_key_press): honor min_width and
+       max_width while resizing columns (pointed out by Jorn Baayen)
+
 Fri Feb 22 19:17:46 2002  Owen Taylor  <otaylor@redhat.com>
 
        Patch from Matthias Clasen (#54488)
index e6b85e16d49c315ff6999479f69142ff27902736..c6a438c3c72ea5f745d661a05f8dc73f75db2651 100644 (file)
@@ -1,3 +1,8 @@
+Sat Feb 23 03:10:20 2002  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreeview.c (gtk_tree_view_key_press): honor min_width and
+       max_width while resizing columns (pointed out by Jorn Baayen)
+
 Fri Feb 22 19:17:46 2002  Owen Taylor  <otaylor@redhat.com>
 
        Patch from Matthias Clasen (#54488)
index e6b85e16d49c315ff6999479f69142ff27902736..c6a438c3c72ea5f745d661a05f8dc73f75db2651 100644 (file)
@@ -1,3 +1,8 @@
+Sat Feb 23 03:10:20 2002  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreeview.c (gtk_tree_view_key_press): honor min_width and
+       max_width while resizing columns (pointed out by Jorn Baayen)
+
 Fri Feb 22 19:17:46 2002  Owen Taylor  <otaylor@redhat.com>
 
        Patch from Matthias Clasen (#54488)
index e6b85e16d49c315ff6999479f69142ff27902736..c6a438c3c72ea5f745d661a05f8dc73f75db2651 100644 (file)
@@ -1,3 +1,8 @@
+Sat Feb 23 03:10:20 2002  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreeview.c (gtk_tree_view_key_press): honor min_width and
+       max_width while resizing columns (pointed out by Jorn Baayen)
+
 Fri Feb 22 19:17:46 2002  Owen Taylor  <otaylor@redhat.com>
 
        Patch from Matthias Clasen (#54488)
index e6b85e16d49c315ff6999479f69142ff27902736..c6a438c3c72ea5f745d661a05f8dc73f75db2651 100644 (file)
@@ -1,3 +1,8 @@
+Sat Feb 23 03:10:20 2002  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreeview.c (gtk_tree_view_key_press): honor min_width and
+       max_width while resizing columns (pointed out by Jorn Baayen)
+
 Fri Feb 22 19:17:46 2002  Owen Taylor  <otaylor@redhat.com>
 
        Patch from Matthias Clasen (#54488)
index e6b85e16d49c315ff6999479f69142ff27902736..c6a438c3c72ea5f745d661a05f8dc73f75db2651 100644 (file)
@@ -1,3 +1,8 @@
+Sat Feb 23 03:10:20 2002  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreeview.c (gtk_tree_view_key_press): honor min_width and
+       max_width while resizing columns (pointed out by Jorn Baayen)
+
 Fri Feb 22 19:17:46 2002  Owen Taylor  <otaylor@redhat.com>
 
        Patch from Matthias Clasen (#54488)
index e6b85e16d49c315ff6999479f69142ff27902736..c6a438c3c72ea5f745d661a05f8dc73f75db2651 100644 (file)
@@ -1,3 +1,8 @@
+Sat Feb 23 03:10:20 2002  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreeview.c (gtk_tree_view_key_press): honor min_width and
+       max_width while resizing columns (pointed out by Jorn Baayen)
+
 Fri Feb 22 19:17:46 2002  Owen Taylor  <otaylor@redhat.com>
 
        Patch from Matthias Clasen (#54488)
index f8c3ac6e0a9de422f60de36568d232a487e7659d..2f9166d906daa804ed4c00a06935bf78a8470f0a 100644 (file)
@@ -3372,8 +3372,15 @@ gtk_tree_view_key_press (GtkWidget   *widget,
                  column->resized_width -= 2;
                  if (column->resized_width < 0)
                    column->resized_width = 0;
-                 column->resized_width = MAX (column->min_width,
-                                              column->resized_width);
+
+                 if (column->min_width == -1)
+                   column->resized_width = MAX (column->button->requisition.width, column->resized_width);
+                 else
+                   column->resized_width = MAX (column->min_width, column->resized_width);
+
+                 if (column->max_width != -1)
+                   column->resized_width = MIN (column->resized_width, column->max_width);
+
                  column->use_resized_width = TRUE;
                  gtk_widget_queue_resize (widget);
                  return TRUE;
@@ -3383,6 +3390,10 @@ gtk_tree_view_key_press (GtkWidget   *widget,
                  column->resized_width = MAX (column->resized_width,
                                               column->width);
                  column->resized_width += 2;
+
+                 if (column->max_width != -1)
+                   column->resized_width = MIN (column->resized_width, column->max_width);
+
                  column->use_resized_width = TRUE;
                  gtk_widget_queue_resize (widget);
                  return TRUE;